package com.itheima.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetMealCheckGroupMapper {
    /**
     * 根据套餐id查询关联的检查项id
     */
    @Select("select checkgroup_id from t_setmeal_checkgroup where setmeal_id = #{id}")
    List<Integer> findCheckGroupIdsBySetmealId(Integer id);

    /**
     * 新增套餐和检查组关系
     * @param id
     * @param checkgroupIds
     */
    void add(Integer id, List<String> checkgroupIds);

    /**
     * 根据setmealId来删
     * @param setmealId
     */
    @Delete("delete from t_setmeal_checkgroup where setmeal_id = #{setmealId}")
    void deleteById(Integer setmealId);
}
